<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<script>
    let user = {
        name: "why",
        age: 18,
        sex: "男"
    }
    console.log(user)

    // 将JavaScript对象转json对象
    let json = JSON.stringify(user);
    console.log(json)

    // 将json对象 转JavaScript对象
    let parse = JSON.parse(json);
    console.log(parse)

</script>

</body>
</html>